//同一文件中是否存在BP，截停注释应为 新原价促销活动ARTR，
// 生效日等于新促销生效日或早于新促销生效日7天的数据
//Retailflag = 1 New Retail< 截停的Retail
//Retailflag = 0  New Retail>=截停的Retail
function checkAddBP(ITEM_NBR, ITEM_LIST, D1, Retailflag) {
    for (var i = 0; i < ITEM_LIST.length; i++) {
        if (ITEM_LIST[i].RETAIL_TYPE == 'BP'
            && ITEM_LIST[i].SUSPEND_ARTR_COMMENT == '新原价促销活动ARTR'
            && ITEM_NBR == ITEM_LIST[i].ITEM_NBR
            && ID != ITEM_LIST[i].ID) {
            if (betweenDay(new Date(ITEM_LIST[i].NEW_RETAIL_EFF_DATE), new Date()) > 1) {
                ITEM_LIST[i].NEW_RETAIL_EFF_DATE = getNewDate(new Date());
            }
            if (betweenDay(new Date(D1), new Date()) > 1) {
                D1 = getNewDate(new Date());
            }
            if (Retailflag == 1
                && (ITEM_LIST[i].NEW_RETAIL_EFF_DATE == D1
                    || betweenDay(new Date(ITEM_LIST[i].NEW_RETAIL_EFF_DATE), new Date(new Date(D1).setDate(new Date(D1).getDate() - 7))) >= 0)) {
                return true;
            }
            if (Retailflag == 0
                && betweenDay(new Date(ITEM_LIST[i].NEW_RETAIL_EFF_DATE), new Date(new Date(D1).setDate(new Date(D1).getDate() - 7))) >= 0) {
                return true;
            }
        }
    }
    return false;
}
